package com.qdu.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.qdu.entity.Job;
import com.qdu.entity.Resume;

public interface JobMapper {
	//管理员用于获得所有的工作列表
	@Select("select jid, b.bname,ba.batchname,j.jobname,j.welfare,"
			+ "j.jeducation,j.jptime,j.jnumber,j.jsalary from job j,bussiness b,batch ba "
			+ "WHERE j.batchid = ba.batchid and ba.bid = j.bid AND b.bid = j.bid")
	List<Map<String,Object>> getAll();
	
	//获取单个工作详情
	@Select("select * from job where jid=#{jid}")
	Job getOneByjid(String jid);
	
	@Insert("insert into job(bid,batchid,jobname,jobdetails,jeducation,jsalary,jnumber,jtime,jptime,welfare) "
			+ "values(#{bid},#{batchid},#{jobname},#{jobdetails},#{jeducation},#{jsalary},#{jnumber},#{jtime},#{jptime},#{welfare})")
	 int addJob(Job job);
	
	@Select("select * from job j,bussiness b where j.bid=b.bid and j.bid=#{bid} and j.batchid=#{batchid}")
	List<Map<String,Object>> getByHr(@Param("bid") String bid,@Param("batchid") String batchid);

		List<Resume> getListInfoByJobId(String jobId);

		int reviewJobApply(com.qdu.entity.Process process);
}
